package demo8;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context
                = new AnnotationConfigApplicationContext("demo8");
        Person person = context.getBean(Person.class);
//        System.out.println(person.getName());
        System.out.println(person);
        context.close();//关闭容器,销毁对象
    }
}
